Skip to content

DEV-446: Read Apple sign-in tokens from the URL fragment - #12

Merged
xkickflip merged 1 commit into
mainfrom
chris-dev-446-oauth-token-fragment
Nov 19, 2026
Merged

xkickflip merged 1 commit into
mainfrom
chris-dev-446-oauth-token-fragment

Conversation

@xkickflip

Copy link
Copy Markdown
Member

Part of the DEV-446 security audit. After Apple web sign-in, the API redirects to /oauth-callback with the access and refresh tokens in the query string, so they end up in browser history and hosting logs.

  • Read the Apple tokens from the URL fragment, falling back to the old ?code=&refresh_token= query
  • Clear them from the address bar and history right away
  • Store the Apple refresh token instead of dropping it, so Apple web sessions renew like Google and GitHub

Ship this before the API change that moves the tokens to the fragment; it works with the API as it is today.

- oauth-callback takes the Apple access and refresh tokens from the
  URL fragment, which never reaches a server, log or Referer
- Falls back to the old ?code=&refresh_token= query, so it works
  before and after the API switches
- Clears the tokens from the address bar and history right away
- Stores the Apple refresh token instead of dropping it, so Apple web
  sessions renew like Google and GitHub ones
@xkickflip
xkickflip merged commit 857a604 into main Nov 19, 2026
1 check passed
@xkickflip
xkickflip deleted the chris-dev-446-oauth-token-fragment branch November 19, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant